package labox.innovation.gameserver.network.serverpackets;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import labox.innovation.config.Config;
import labox.innovation.gameserver.model.FuzeWorld;
import labox.innovation.gameserver.model.Scene;

/**
 * ���͸�ͻ���ĳ�������ϵĵ�ͼ���
 * 
 * @version $Revision: 1.3.2.1.2.3 $ $Date: 2005/03/27 15:29:39 $
 */
public final class SceneMap extends L2GameServerPacket {

	private static final Logger _log = LoggerFactory.getLogger(SceneMap.class.getName());

	private static final String _S_SCENEMAP = "[S] 22 SceneMap";

	private int sceneId;

	public SceneMap(int id) {
		sceneId = id;
	}

	@Override
	protected final void writeImpl() {
		writeByte(PTL_SCENEMAP);
		Scene scn = FuzeWorld.getInstance().getScene(sceneId);
		if (scn == null) {
			_log.error("Request Scene Id invaild,id:" + sceneId, Config.SERVER_ID);
			return;
		}
		writeShort(sceneId);
		writeString(scn.getName());
		writeData(scn.getMapData());
	}

	/* (non-Javadoc)
	 * @see labox.innovation.gameserver.serverpackets.ServerBasePacket#getType()
	 */
	@Override
	public String getType() {
		return _S_SCENEMAP;
	}
}
